



DEFINE VARIABLE part LIKE pt_part.
DEFINE VARIABLE qty LIKE ro_run .



DEFINE STREAM bf .

INPUT FROM VALUE("c:\ro.txt").

OUTPUT STREAM bf TO VALUE("c:\ro_del.txt") .

REPEAT ON ERROR UNDO, LEAVE:  


        IMPORT DELIMITER "," part.

        PUT STREAM bf UNFORMATTED "@@batchload rwromt.p" SKIP.

        /*
        PUT STREAM bf UNFORMATTED """" + ro_routing + """ " """" + STRING(ro_op) + """ " """" + STRING(ro_start) + """ ""x""" SKIP.
        */

        FIND FIRST ro_det NO-LOCK WHERE ro_routing = part AND ro_op <> 10 NO-ERROR.

        EXPORT STREAM bf ro_routing  STRING(ro_op) STRING(ro_start) "x" .


        PUT STREAM bf UNFORMATTED "-" SKIP.
        PUT STREAM bf UNFORMATTED "yes" SKIP.

        PUT STREAM bf UNFORMATTED "@@end" SKIP.


END.

